<cfcomponent extends="assets.calgrants.com.Base">
	
	<cfscript>
		this.bo = CreateObject("component", "assets.calgrants.com.bo.MobileFacebookLike").init();
	</cfscript>

	<cffunction name="init" access="public" output="false" returntype="any">
		<cfreturn this />
	</cffunction>
	
	<cffunction name="get" access="public" output="false" returntype="struct">
		<cfargument name="Mobile_Facebook_Like_ID" type="numeric" required="true" />
		<cfset var mobileFacebookLike = "" />
		<cfif arguments.Mobile_Facebook_Like_ID gt 0>
			<cfset mobileFacebookLike = QueryToStruct(read(argumentCollection = arguments))[1] />
		<cfelse>
			<cfset mobileFacebookLike = this.bo />
		</cfif>
		<cfreturn mobileFacebookLike />
	</cffunction>

	<cffunction name="read" access="public" output="false" returntype="any">
		<cfargument name="Mobile_Facebook_Like_ID" required="false" default="" />
		<cfargument name="Program_Year" required="false" default="" />
		<cfargument name="Deleted" required="false" default="0" />
		<cfargument name="URL" required="false" default="" />
		<cfargument name="Date_Created" required="false" default="" />

		<cfset var recs = "">
		<cfstoredproc datasource="#getDatasource()#" procedure="readMobileFacebookLike">
			<cfprocparam value="#arguments.Mobile_Facebook_Like_ID#" cfsqltype="CF_SQL_INTEGER" null="#IIf(Len(Trim(arguments.Mobile_Facebook_Like_ID)) eq 0, true, false)#" />
			<cfprocparam value="#arguments.Program_Year#" cfsqltype="CF_SQL_VARCHAR" null="#IIf(Len(Trim(arguments.Program_Year)) eq 0, true, false)#" />
			<cfprocparam value="#arguments.Deleted#" cfsqltype="CF_SQL_BIT" null="#IIf(Len(Trim(arguments.Deleted)) eq 0, true, false)#" />
			<cfprocparam value="#arguments.URL#" cfsqltype="CF_SQL_VARCHAR" null="#IIf(Len(Trim(arguments.URL)) eq 0, true, false)#" />
			<cfprocparam value="#arguments.Date_Created#" cfsqltype="CF_SQL_TIMESTAMP" null="#IIf(Len(Trim(arguments.Date_Created)) eq 0, true, false)#" />
			<cfprocresult name="recs" />
		</cfstoredproc>
		<cfreturn recs />
	</cffunction>

	<cffunction name="save" access="public" output="false" returntype="any">
		<cfargument name="Mobile_Facebook_Like_ID" required="true" />
		<cfargument name="Program_Year" required="false" default="" />
		<cfargument name="Deleted" required="true" />
		<cfargument name="URL" required="true" />

		<cfstoredproc datasource="#getDatasource()#" procedure="saveMobileFacebookLike">
			<cfprocparam value="#arguments.Mobile_Facebook_Like_ID#" cfsqltype="CF_SQL_INTEGER" variable="id" type="inout" null="false" />
			<cfprocparam value="#arguments.Program_Year#" cfsqltype="CF_SQL_VARCHAR" null="#IIf(Len(Trim(arguments.Program_Year)) eq 0, true, false)#" />
			<cfprocparam value="#arguments.Deleted#" cfsqltype="CF_SQL_BIT" null="false" />
			<cfprocparam value="#arguments.URL#" cfsqltype="CF_SQL_VARCHAR" null="false" />
		</cfstoredproc>
		<cfreturn id />
	</cffunction>

	<cffunction name="destroy" access="public" output="false" returntype="any">
		<cfargument name="Mobile_Facebook_Like_ID" required="true" />

		<cfstoredproc datasource="#getDatasource()#" procedure="destroyMobileFacebookLike">
			<cfprocparam value="#arguments.Mobile_Facebook_Like_ID#" cfsqltype="CF_SQL_INTEGER" null="false" />
			<cfprocparam value="true" cfsqltype="CF_SQL_BIT" null="false" />
		</cfstoredproc>
		<cfreturn true />
	</cffunction>

</cfcomponent>

